﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Popup.Master" AutoEventWireup="true" CodeBehind="HR_AddNewMultiRotationHR.aspx.cs" Inherits="vHCS.K2App.MdlK2.HR_AddNewMultiRotationHR" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.Security" TagPrefix="security" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.DataReader" TagPrefix="core" %>
<%@ Register Src="~/MdlK2/Controls/HR_ctrUserSearch.ascx" TagName="HR_ctrlUserSearch" TagPrefix="uc1" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.Message" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainToolbar" runat="server">
    <asp:HiddenField ID="hdfListEmp" runat="server" />
    <asp:HiddenField ID="hdfuser" runat="server" />
    <cc1:MessageSetting ID="mssUsedMessageList" runat="server" meta:resourcekey="mssUsedMessageListResource1">
        <Items>
            <cc1:Message Code="12245" />
        </Items>
    </cc1:MessageSetting>
    <asp:Button ID="btnSubmit_Top" runat="server" Text="Submit" CssClass="btnSubmit"
        OnClick="btnSubmit_Top_Click" OnClientClick="return check.CheckValidForDelete(this,event);" ValidationGroup="SaveGrid" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="searchWrapper">
        <uc1:HR_ctrlUserSearch ID="HR_ctrlUserSearch1" runat="server" />
    </div>
    <div class="controlWrapper">
        <div class="divButton">
            <asp:Button ID="btnTimKiem" runat="server" Text="Tìm kiếm" CssClass="btnFind" OnClick="btnTimKiem_Click" />
            <asp:Button ID="btnRefresh" runat="server" Text="Làm mới" CssClass="btnRefresh" OnClick="btnRefresh_Click" />
        </div>
        <div class="divGrid" style="width: 99%; padding-left: 5px">
            <telerik:RadGrid ID="dtgWorkingRecord" runat="server" AutoGenerateColumns="False"
                AllowPaging="True" AllowMultiRowSelection="True" OnItemDataBound="dtgWorkingRecord_ItemDataBound"
                GridLines="None">
                <ClientSettings>
                    <ClientEvents OnRowSelected="RowSelectInGrid" OnRowDeselected="RowUnSelectInGrid" />
                </ClientSettings>
                <MasterTableView Width="100%" Font-Names="Arial" Font-Size="10pt">
                    <Columns>
                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-HorizontalAlign="Center"
                            HeaderStyle-Width="40" HeaderStyle-HorizontalAlign="Center">
                            <HeaderStyle Width="30px"></HeaderStyle>
                        </telerik:GridClientSelectColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="50px" HeaderText="Quyết định" HeaderStyle-HorizontalAlign="Center"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkquyedinh" runat="server" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="30px" HeaderText="STT" AllowFiltering="false"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%# Container.ItemIndex + 1 + dtgWorkingRecord.PageSize * dtgWorkingRecord.CurrentPageIndex%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="EmpCode" HeaderText="Mã nhân viên" HeaderStyle-Width="100px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="FullName" HeaderText="Họ tên nhân viên" HeaderStyle-Width="100px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="OrgChartName" HeaderText="Cơ cấu tổ chức cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                            DataType="System.String" />
                        <telerik:GridBoundColumn DataField="ProJobVNFull" HeaderText="Cơ cấu chuyên môn cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                            DataType="System.String" />
                        <telerik:GridBoundColumn DataField="MgtFullNameVN" HeaderText="Cơ cấu quản lý cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                            DataType="System.String" />
                        <telerik:GridBoundColumn DataField="JobLevelName" HeaderText="Cấp bậc cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="JobTitleName" HeaderText="Chức vụ cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="JobRole" HeaderText="Job role cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="EmpTypeName" HeaderText="Loại nhân viên cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="WorkplaceName" HeaderText="Văn phòng làm việc cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                            DataType="System.String" />
                        <telerik:GridBoundColumn DataField="Leader" HeaderText="Leader(theo cơ cấu)cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="ReportingLine" HeaderText="Người báo cáo cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"
                            DataType="System.String" />
                        <telerik:GridBoundColumn DataField="Approver" HeaderText="Người phê duyệt cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="Mentor" HeaderText="Người mentor hiện tại" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.String" />
                        <telerik:GridBoundColumn DataField="GrossSalary" HeaderText="Lương gross hiện tại"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            DataType="System.Double" DataFormatString="{0:###,###}" />
                        <telerik:GridBoundColumn DataField="BasisSalary" HeaderText="Lương căn bản hiện tại"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            DataType="System.Double" DataFormatString="{0:###,###}" />
                        <telerik:GridBoundColumn DataField="KPI" HeaderText="KPI hiện tại" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" DataType="System.Double"
                            DataFormatString="{0:###,###}" />
                        <telerik:GridBoundColumn DataField="GeneralSusidies" HeaderText="Trợ cấp tổng hợp cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            DataType="System.Double" DataFormatString="{0:###,###}" />
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Loại hình thức thay đổi"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboLoaiHinhThuc" runat="server" Width="100%" DataSourceID="dtsChangType"
                                    DataTextField="Name" DataValueField="ID" AutoPostBack="True" OnSelectedIndexChanged="cboChangeType_SelectedIndexChanged">
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="rfvLoaiHTTD" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboLoaiHinhThuc"
                                ErrorMessage="Vui lòng nhập loại hình thức thay đổi" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Hình thức thay đổi"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboHinhthucthaydoi" runat="server" Width="100%">
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="rfvHTTD" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboHinhthucthaydoi"
                                ErrorMessage="Vui lòng nhập hình thức thay đổi" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                            </ItemTemplate>
                            
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Ngày hiệu lực"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadDatePicker ID="dpkNgayhieuluc" runat="server" MinDate="01/01/1900" MaxDate="01/01/9999">
                                </telerik:RadDatePicker>
                                <asp:RequiredFieldValidator ID="rfvNgayhieuluc" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="dpkNgayhieuluc"
                                ErrorMessage="Vui lòng nhập ngày hiệu lực" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Cơ cấu tổ chức mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboOrgChart" runat="server" Width="99%" Filter="Contains"
                                    DropDownWidth="400px" Height="400px"
                                    EmptyMessage="Chọn cây cơ cấu tổ chức" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                                    <ItemTemplate>
                                        <div class="noneItem" onclick="treeOrgChart.noneItemClick();">
                                        </div>
                                        <div id="divOrgChart" onclick="treeOrgChart.StopPropagation(event);">
                                            <telerik:RadTreeView runat="server" ID="trvOrgChart" Width="100%" OnClientNodeClicking="treeOrgChart.nodeClicking"
                                                DataFieldID="HierarchyId" DataFieldParentID="ParentId" DataSourceID="dtsOrgChart"
                                                DataTextField="HierarchyName" DataValueField="HierarchyId" OnDataBound="trvOrgChart_OnDataBound"
                                                OnNodeClick="trvOrgChart_NodeClick">
                                            </telerik:RadTreeView>
                                        </div>
                                        <div class="divButton">
                                            <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" runat="server" OnClientClick="treeOrgChart.treeCollapseAllNodes(); return false;"
                                                Text="Thu nhỏ"></asp:LinkButton>
                                            <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" runat="server" OnClientClick="treeOrgChart.treeExpandAllNodes(); return false;"
                                                Text="Mở rộng"></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="" />
                                    </Items>
                                    <ExpandAnimation Type="None"></ExpandAnimation>
                                    <CollapseAnimation Type="None"></CollapseAnimation>
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="rfvCocautochuc" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboOrgChart"
                                ErrorMessage="Vui lòng nhập cơ cấu tổ chức" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Chức vụ mới" HeaderStyle-HorizontalAlign="Center"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboChucvu" runat="server" DataTextField="Name" DataValueField="ID" AutoPostBack="true" 
                                    OnSelectedIndexChanged="cboChucvu_SelectedIndexChanged" OnItemsRequested="RadComboBox_ItemRequested" EnableLoadOnDemand="True" MarkFirstMatch="true" HighlightTemplatedItems="True">
                                </telerik:RadComboBox>

                                <%--Lay du lieu cho combo chuc vu--%>
                                <core:CoreDataSource ID="dtsJobTitle" runat="server" SelectMethod="GetComboItems_ForWR"
                                    EnableCaching="false" TypeName="vHCS.LS.Business.LS_JobTitleCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="jobLevelId" DefaultValue="0" DbType="Int64" />
                                        <asp:Parameter Name="jobFamilyId" DefaultValue="0" DbType="Int64" />
                                        <asp:Parameter Name="jobGroupId" DefaultValue="0" DbType="Int64" />
                                        <asp:Parameter Name="subGroupId" DefaultValue="0" DbType="Int64" />
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="true" DbType="Boolean" />
                                        <asp:Parameter Name="effectivedate" DefaultValue="" DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>

                                <asp:RequiredFieldValidator ID="rfvChucvu" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboChucvu"
                                ErrorMessage="Vui lòng nhập chức vụ" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="Cơ cấu chuyên môn mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Panel ID="pnlProChart" runat="server">
                                <telerik:RadComboBox ID="cboProChart" runat="server" Width="50%" Height="400px" DropDownWidth="500px"
                                    EmptyMessage="Chọn cơ cấu chuyên môn" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                                    <ItemTemplate>
                                        <div class="noneItem" onclick="treeProChart.noneItemClick();">
                                        </div>
                                        <div class="divTreeOnRadCombo" id="divProChart" onclick="treeProChart.StopPropagation(event);">
                                            <telerik:RadTreeView runat="server" ID="trvProChart" Width="100%" DataFieldID="HierarchyId"
                                                DataFieldParentID="ParentId" DataTextField="HierarchyName"
                                                DataValueField="HierarchyId" OnClientNodeClicking="treeProChart.nodeClicking">
                                            </telerik:RadTreeView>
                                        </div>
                                        <div class="divButton">
                                            <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" OnClientClick="treeProChart.treeCollapseAllNodes(); return false;"
                                                runat="server" Text="Thu nhỏ"></asp:LinkButton>
                                            <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" OnClientClick="treeProChart.treeExpandAllNodes(); return false;"
                                                runat="server" Text="Mở rộng"></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="" />
                                    </Items>
                                    <ExpandAnimation Type="None"></ExpandAnimation>
                                    <CollapseAnimation Type="None"></CollapseAnimation>
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="rfvProChart" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboProChart"
                                ErrorMessage="Vui lòng nhập cơ cấu chuyên môn" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>

                                <core:CoreDataSource ID="dtsProChart" runat="server" SelectMethod="FindProChart_ByJobtitle"
                                    TypeName="vHCS.HR.Business.HIE_HierarchyCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:ControlParameter Name="Jobtitle" ControlID="cboChucvu" PropertyName="SelectedValue" DbType="Int64" />
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="effectivedate" DefaultValue="" DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>

                                <%--Load thong tin ProRanking --%>
                                <telerik:RadComboBox ID="cboProRanking" runat="server" Width="24%" DataSourceID="dtsProRanking"
                                    DataTextField="Name" DataValueField="ID" AutoPostBack="true" OnSelectedIndexChanged="cboProRanking_SelectedIndexChanged">
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsProRanking" runat="server" SelectMethod="GetComboItems_EffectiveDate"
                                    TypeName="vHCS.LS.Business.LS_RankingLevelCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />
                                        <asp:Parameter Name="effectivedate" DefaultValue=""
                                            DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                <%--Load thong tin ProGrade --%>
                                <telerik:RadComboBox ID="cboProGrade" runat="server" Width="22%" DataSourceID="dtsProGrade"
                                    DataTextField="Name" DataValueField="ID">
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsProGrade" runat="server" SelectMethod="GetComboItems_Effectivedate"
                                    TypeName="vHCS.LS.Business.LS_GradeCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />
                                        <asp:Parameter Name="effectivedate" DefaultValue=""
                                            DbType="DateTime" />
                                        <asp:Parameter Name="rankingid" DefaultValue=""
                                            DbType="Int64" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                </asp:Panel> 
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="Cơ cấu quản lý mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Panel ID="pnlMgtChart" runat="server">
                                <telerik:RadComboBox ID="cboMgtChart" runat="server" Width="50%" Height="400px" DropDownWidth="500px"
                                    EmptyMessage="Chọn cơ cấu quản lý" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                                    <ItemTemplate>
                                        <div class="noneItem" onclick="treeMgtChart.noneItemClick();">
                                        </div>
                                        <div class="divTreeOnRadCombo" id="divMgtChart" onclick="treeMgtChart.StopPropagation(event);">
                                            <telerik:RadTreeView runat="server" ID="trvMgtChart" Width="100%" DataFieldID="HierarchyId"
                                                DataFieldParentID="ParentId" DataTextField="HierarchyName"
                                                DataValueField="HierarchyId" OnClientNodeClicking="treeMgtChart.nodeClicking">
                                            </telerik:RadTreeView>
                                        </div>
                                        <div class="divButton">
                                            <asp:LinkButton ID="btnCollapseAll" CssClass="treeCollapse" OnClientClick="treeMgtChart.treeCollapseAllNodes(); return false;"
                                                runat="server" Text="Thu nhỏ"></asp:LinkButton>
                                            <asp:LinkButton ID="btnExpandAll" CssClass="treeExpand" OnClientClick="treeMgtChart.treeExpandAllNodes(); return false;"
                                                runat="server" Text="Mở rộng"></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="" />
                                    </Items>
                                    <ExpandAnimation Type="None"></ExpandAnimation>
                                    <CollapseAnimation Type="None"></CollapseAnimation>
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsMgtChart" runat="server" SelectMethod="FindMgtChart_ByJobtitle"
                                    TypeName="vHCS.HR.Business.HIE_HierarchyCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:ControlParameter Name="Jobtitle" ControlID="cboChucvu" PropertyName="SelectedValue" DbType="Int64" />
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="effectivedate" DefaultValue="" DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                <telerik:RadComboBox ID="cboMgtRaking" runat="server" Width="24%" DataSourceID="dtsMgtRanking"
                                    DataTextField="Name" DataValueField="ID" AutoPostBack="true" OnSelectedIndexChanged="cboMgtRaking_SelectedIndexChanged">
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsMgtRanking" runat="server" SelectMethod="GetComboItems_EffectiveDate"
                                    TypeName="vHCS.LS.Business.LS_RankingLevelCollection" MaximumRowsParameterName="" >
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />
                                        <asp:Parameter Name="effectivedate" DefaultValue=""
                                            DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                <telerik:RadComboBox ID="cboMgtGrade" runat="server" Width="22%" DataSourceID="dtsMgtGrade"
                                    DataValueField="ID" DataTextField="Name">
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsMgtGrade" runat="server" SelectMethod="GetComboItems_Effectivedate"
                                    TypeName="vHCS.LS.Business.LS_GradeCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />
                                        <asp:Parameter Name="effectivedate" DefaultValue=""
                                            DbType="DateTime" />
                                        <asp:Parameter Name="rankingid" DefaultValue=""
                                            DbType="Int64" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                </asp:Panel>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Loại nhân viên mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:TextBox ID="txtLoaiNhanVien" runat="server" CssClass="inputReadOnly" ReadOnly="true"></asp:TextBox>
                                <div style="display: none">
                                    <asp:TextBox ID="txtLoaiNhanVienID" runat="server"></asp:TextBox>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Cấp bậc mới" HeaderStyle-HorizontalAlign="Center"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboCapbac" runat="server" DataTextField="Name"
                                    DataValueField="ID" OnSelectedIndexChanged="cboCapbac_SelectedIndexChanged" AutoPostBack="true">
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="rfvCapbac" runat="server" CssClass="validation" Display="Dynamic" ControlToValidate="cboCapbac"
                                ErrorMessage="Vui lòng nhập cấp bậc" SetFocusOnError="true" ValidationGroup="SaveGrid" Enabled="false"></asp:RequiredFieldValidator>
                                <core:CoreDataSource ID="dtsJobLevel" runat="server" SelectMethod="GetComboItems_ByJotitle"
                                    TypeName="vHCS.LS.Business.LS_JobLevelCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" />
                                        <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />
                                        <asp:Parameter Name="jobtitle" DefaultValue="0" DbType="Int64" />
                                        <asp:Parameter Name="effectivedate" DefaultValue="" DbType="DateTime" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Jop role mới" HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center"
                            ItemStyle-HorizontalAlign="Left">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboJobRole" Width="100%" DataTextField="Name" DataValueField="Id"
                                    DataSourceID="dtsJobRole" AllowCustomText="true" HighlightTemplatedItems="true"
                                    Filter="Contains" OnClientSelectedIndexChanging="chkJobRole.OnClientSelectedIndexChanging"
                                    OnClientDropDownOpened="chkJobRole.DropDownOpenHandler" runat="server">
                                    <ItemTemplate>
                                        <div style="width: 100%" onclick="chkJobRole.OnClick(this,event);">
                                            <asp:CheckBox runat="server" ID="chkJobRole" onclick="chkJobRole.OnClick(this,event);"
                                                Text="" />
                                            <%# DataBinder.Eval(Container, "Text") %>
                                        </div>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <div class="divButton">
                                            <asp:LinkButton ID="btnSelectAll" OnClientClick="chkJobRole.SelectAll();return false;"
                                                CssClass="selectAll" runat="server" Text="Chọn tất cả"></asp:LinkButton>
                                            <asp:LinkButton ID="btnUnSelectAll" OnClientClick="chkJobRole.DeselectAll();return false;"
                                                CssClass="deselectAll" runat="server" Text="Bỏ chọn"></asp:LinkButton>
                                        </div>
                                    </FooterTemplate>
                                </telerik:RadComboBox>
                                <div style="display: none">
                                    <asp:TextBox ID="txtJobRoleID" runat="server"></asp:TextBox>
                                </div>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Văn phòng làm việc mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboVanphonglamviec" runat="server" Width="100%" DataSourceID="dtsOffice"
                                    DataTextField="Name" DataValueField="ID">
                                </telerik:RadComboBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Div / Dep / Team Head mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:TextBox ID="txtLeader" runat="server" ReadOnly="true" CssClass="inputReadOnly"
                                    Width="100%"></asp:TextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="180px" HeaderText="Người báo cáo mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboReportTo" Width="100%" MarkFirstMatch="true" HighlightTemplatedItems="True"
                                    DropDownWidth="500px" EnableLoadOnDemand="True" OnItemsRequested="RadComboBox_ItemRequested"
                                    runat="server" AllowCustomText="false" DataTextField="Name"
                                    DataValueField="Id">
                                    <HeaderTemplate>
                                        <ul class="comboHeader">
                                            <li class="code">
                                                <asp:Label ID="Label2" runat="server" Text="Mã"></asp:Label>
                                            </li>
                                            <li class="name">
                                                <asp:Label ID="Label3" runat="server" Text="Tên"></asp:Label>
                                            </li>
                                            <li class="divClear"></li>
                                        </ul>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <ul class="comboItem">
                                            <li class="code">
                                                <%#DataBinder.Eval(Container.DataItem, "Code")%></li>
                                            <li class="name">
                                                <%#DataBinder.Eval(Container.DataItem, "Name")%></li>
                                        </ul>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <div class="comboFooter">
                                            <asp:Label ID="Label4" runat="server" Text="Please enter text to show more items"></asp:Label>
                                        </div>
                                    </FooterTemplate>
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsReportTo" runat="server" SelectMethod="GetComboItems"
                                    TypeName="vHCS.SYS.Business.SYS_UsersCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Người phê duyệt mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboNguoiPheDuyet" Width="100%" MarkFirstMatch="true" HighlightTemplatedItems="True"
                                    DropDownWidth="500px" EnableLoadOnDemand="True" OnItemsRequested="RadComboBox_ItemRequested"
                                    runat="server" AllowCustomText="false" DataTextField="Name"
                                    DataValueField="Id">
                                    <HeaderTemplate>
                                        <ul class="comboHeader">
                                            <li class="code">
                                                <asp:Label ID="Label2" runat="server" Text="Mã"></asp:Label>
                                            </li>
                                            <li class="name">
                                                <asp:Label ID="Label3" runat="server" Text="Tên"></asp:Label>
                                            </li>
                                            <li class="divClear"></li>
                                        </ul>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <ul class="comboItem">
                                            <li class="code">
                                                <%#DataBinder.Eval(Container.DataItem, "Code")%></li>
                                            <li class="name">
                                                <%#DataBinder.Eval(Container.DataItem, "Name")%></li>
                                        </ul>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <div class="comboFooter">
                                            <asp:Label ID="Label4" runat="server" Text="Please enter text to show more items"></asp:Label>
                                        </div>
                                    </FooterTemplate>
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsApprover" runat="server" SelectMethod="GetComboItems"
                                    TypeName="vHCS.SYS.Business.SYS_UsersCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                                
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Người mentor mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="cboNguoiMentor" Width="100%" MarkFirstMatch="true" HighlightTemplatedItems="True"
                                    DropDownWidth="500px" EnableLoadOnDemand="True" OnItemsRequested="RadComboBox_ItemRequested"
                                    runat="server" AllowCustomText="false" DataTextField="Name"
                                    DataValueField="Id">
                                    <HeaderTemplate>
                                        <ul class="comboHeader">
                                            <li class="code">
                                                <asp:Label ID="Label2" runat="server" Text="Mã"></asp:Label>
                                            </li>
                                            <li class="name">
                                                <asp:Label ID="Label3" runat="server" Text="Tên"></asp:Label>
                                            </li>
                                            <li class="divClear"></li>
                                        </ul>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <ul class="comboItem">
                                            <li class="code">
                                                <%#DataBinder.Eval(Container.DataItem, "Code")%></li>
                                            <li class="name">
                                                <%#DataBinder.Eval(Container.DataItem, "Name")%></li>
                                        </ul>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <div class="comboFooter">
                                            <asp:Label ID="Label4" runat="server" Text="Please enter text to show more items"></asp:Label>
                                        </div>
                                    </FooterTemplate>
                                </telerik:RadComboBox>
                                <core:CoreDataSource ID="dtsMentor" runat="server" SelectMethod="GetComboItems"
                                    TypeName="vHCS.SYS.Business.SYS_UsersCollection" MaximumRowsParameterName="">
                                    <SelectParameters>
                                        <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                                        <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                                        <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />
                                    </SelectParameters>
                                </core:CoreDataSource>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Có duy trì quyền hạn không ?"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkDuytriquyenhan" runat="server" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Có thay đổi lương hay không?"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkChangeSalary" runat="server" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Lương gross mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="txtGross" runat="server" NumberFormat-DecimalDigits="0"
                                    NumberFormat-GroupSeparator="," MaxLength="12" MinValue="0" Width="100">
                                    <EnabledStyle HorizontalAlign="Right" />
                                    <ClientEvents OnValueChanged="calsalary.Cal_Salary" />
                                </telerik:RadNumericTextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Lương căn bản mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="txtLuongcanban" runat="server" NumberFormat-DecimalDigits="0"
                                    NumberFormat-GroupSeparator="," MaxLength="12" MinValue="0" Width="100">
                                    <EnabledStyle HorizontalAlign="Right" />
                                    <ClientEvents OnValueChanged="calsalary.Cal_SalaryCanban" />
                                </telerik:RadNumericTextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="KPI mới" HeaderStyle-HorizontalAlign="Center"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="txtKPI" runat="server" NumberFormat-DecimalDigits="0"
                                    NumberFormat-GroupSeparator="," MaxLength="12" MinValue="0" Width="100">
                                    <EnabledStyle HorizontalAlign="Right" />
                                    <ClientEvents OnValueChanged="calsalary.Call_SalaryKPI" />
                                </telerik:RadNumericTextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="140px" HeaderText="Trợ cấp tổng hợp mới"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="txtTrocaptonghop" runat="server" NumberFormat-DecimalDigits="0"
                                    NumberFormat-GroupSeparator="," MaxLength="12" MinValue="0" Width="100">
                                    <EnabledStyle HorizontalAlign="Right" />
                                </telerik:RadNumericTextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="300px" HeaderText="File đính kèm"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadAsyncUpload ID="uplFileUpload" runat="server" InitialFileInputsCount="1"
                                    MaxFileInputsCount="1" MaxFileSize="4194304" AllowedFileExtensions=".doc,.docx,.pdf,.xls,.xlsx,.jpg,.gif,.jpeg,.png" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <%--Lấy dữ liệu ẩn để load lên các control--%>
                        <telerik:GridBoundColumn DataField="LSStatusChangeID" HeaderText="Trợ cấp khác cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            Visible="false" />
                        <telerik:GridBoundColumn DataField="LSChangeFormTypeID" HeaderText="Trợ cấp khác cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            Visible="false" />
                        <telerik:GridBoundColumn DataField="FromDate" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="HierarchyId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="ProRankingId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="ProGradeId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="MgtGradeId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="MgtRankingId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="LSLevelID" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="JobTitleID" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="WorkingRecordID" HeaderText="Trợ cấp khác cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            Visible="false" />
                        <telerik:GridBoundColumn DataField="LSWorkPlaceID" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="LSEmpTypeID" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="GrossSalary" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="BasisSalary" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="KPI" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="GeneralSusidies" HeaderText="Trợ cấp khác cũ"
                            HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right"
                            Visible="false" />
                        <telerik:GridBoundColumn DataField="EmpID" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="DataModify" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="ProSubGroupId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="MgtSubGroupId" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="Trợ cấp khác cũ" HeaderStyle-Width="140px"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="right" Visible="false" />
                    </Columns>
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="5" HorizontalAlign="Left"
                        Position="Bottom" />
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="5">
                    </Scrolling>
                </ClientSettings>
            </telerik:RadGrid>
            <%--Lay du lieu cho grid--%>
            <core:CoreDataSource ID="dtsWorkingRecord" runat="server" SelectMethod="SelectMultiWR"
                TypeName="vHCS.HR.Business.HR_WorkingRecordCollection" CacheExpirationPolicy="Sliding"
                EnableCaching="False" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:ControlParameter Name="dto" ControlID="HR_ctrlUserSearch1" PropertyName="ItemData" />
                    <asp:Parameter Name="functionid" DefaultValue="0" DbType="Int64" />
                </SelectParameters>
            </core:CoreDataSource>
            <%--Lay du lieu cho loai hinh thuc thay doi--%>
            <core:CoreDataSource ID="dtsChangType" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.LS.Business.LS_ChangeFormTypeCollection" CacheExpirationPolicy="Sliding"
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>
            <telerik:RadAjaxLoadingPanel ID="ajaxLoadingPanel" runat="server">
            </telerik:RadAjaxLoadingPanel>
            <%--Lay du lieu hinh thuc thay doi--%>
            <core:CoreDataSource ID="dtsChangeForm" runat="server" SelectMethod="GetComboItemsByType"
                TypeName="vHCS.LS.Business.LS_ChangeFormCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_lChangeTypeId" DefaultValue="-1" DbType="Int64" />
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>
            <%--Lay du lieu cho combo cay co cau--%>
            <core:CoreDataSource ID="dtsOrgChart" runat="server" SelectMethod="FindOrgChart"
                TypeName="vHCS.HR.Business.HIE_HierarchyCollection" MaximumRowsParameterName="">
            </core:CoreDataSource>
             

            <%--Lay du lieu cho combo cau cau chuyen mon --%>
           <%-- <core:CoreDataSource ID="dtsProChart" runat="server" SelectMethod="FindProChart"
                TypeName="vHCS.HR.Business.HIE_HierarchyCollection" MaximumRowsParameterName="">
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho ProRanking--%>
           <%-- <core:CoreDataSource ID="dtsProRanking" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.SYS.Business.LS_RankingLevelCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho ProGrade--%>
            <%--<core:CoreDataSource ID="dtsProGrade" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.SYS.Business.LS_GradeCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                    <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho combo co cau quan ly--%>
            <%--<core:CoreDataSource ID="dtsMgtChart" runat="server" SelectMethod="FindMgtChart"
                TypeName="vHCS.HR.Business.HIE_HierarchyCollection" MaximumRowsParameterName="">
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho MgtRanking--%>
            <%--<core:CoreDataSource ID="dtsMgtRanking" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.SYS.Business.LS_RankingLevelCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="addNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho MgtGrade--%>
           <%-- <core:CoreDataSource ID="dtsMgtGrade" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.SYS.Business.LS_GradeCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                    <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>--%>
            <%--Lay du lieu cho combo JobRole--%>
            <core:CoreDataSource ID="dtsJobRole" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.LS.Business.LS_JobRoleCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="addNullItem" DefaultValue="false" DbType="Boolean" />
                    <asp:Parameter Name="getTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>
            <%--Lay du lieu cho combo Cap bac--%>
            <%--<core:CoreDataSource ID="dtsJobLevel" runat="server" SelectMethod="GetComboItems"
                TypeName="vHCS.LS.Business.LS_JobLevelCollection" MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>--%>
            
            <%--Lay du lieu cho combo van phong lam viec--%>
            <core:CoreDataSource ID="dtsOffice" runat="server" SelectMethod="GetComboItems" TypeName="vHCS.LS.Business.LS_WorkPlaceCollection"
                MaximumRowsParameterName="">
                <SelectParameters>
                    <asp:Parameter Name="p_strPrefix" DefaultValue="" DbType="String" />
                    <asp:Parameter Name="p_bAddNullItem" DefaultValue="true" DbType="Boolean" />
                    <asp:Parameter Name="p_bGetTop" DefaultValue="false" DbType="Boolean" />
                </SelectParameters>
            </core:CoreDataSource>
            <%--Lay du lieu cho combo nguoi bao cao--%>
            
            
        </div>
        <div class="divClear">
        </div>
        <div class="divButton">
            <asp:Button ID="btnSubmit_Bot" runat="server" Text="Submit" CssClass="btnSubmit"
                OnClick="btnSubmit_Top_Click" OnClientClick="return check.CheckValidForDelete(this,event);" ValidationGroup="SaveGrid" />
        </div>
        <div class="divClear">
        </div>
    </div>
    <telerik:RadAjaxManagerProxy ID="ajaxManager" runat="server">
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <div style="display: none">
        <asp:TextBox ID="hdfJobRoles" Text="" runat="server"></asp:TextBox>
    </div>
    <telerik:RadCodeBlock ID="radCodeBlock" runat="server">
        <script type="text/javascript">

            var treeOrgChart = new TreeViewInRadCombo_Grid('trvOrgChart');
            var treeProChart = new TreeViewInRadCombo_Grid("trvProChart");
            var treeMgtChart = new TreeViewInRadCombo_Grid("trvMgtChart");

            var chkJobRole = new CheckBoxInRadCombo_Grid("<%=hdfJobRoles.ClientID %>");

            var tooltip_jobrole = new SetToolTip("cboJobRole", "rttJobRole_input");

            function SetToolTip(senderid, tooltipid) {
                this.SetToolTip_OrChart = function (sender, args) {
                    var id = sender.get_id();
                    var rtt = $find(id.replace(senderid, tooltipid));

                    rtt.set_text(sender.get_text());
                }
            }

            var calsalary = new CalSalaryGross('txtGross', 'txtLuongcanban', 'txtTrocaptonghop', 'txtKPI');

            //Tính lương căn bản và trợ cấp tổng hợp từ lương gross
            function CalSalaryGross(grossid, basicid, susidiesid, kpi) {
                this.Cal_Salary = function (sender, event) {
                    var basicclientid = sender.get_id().replace(grossid, basicid);
                    var susidiesclientid = sender.get_id().replace(grossid, susidiesid);
                    var kpiclientid = sender.get_id().replace(grossid, kpi);
                    var txtCanban = $find(basicclientid);
                    var txtSusidies = $find(susidiesclientid);
                    var txtKPI = $find(kpiclientid);
                    txtCanban.set_value(sender.get_value() * 65 / 100);
                    txtSusidies.set_value(sender.get_value() - txtCanban.get_value() - txtKPI.get_value());
                }
                this.Cal_SalaryCanban = function (sender, event) {
                    var txtCanban = sender;
                    var susidiesclientid = sender.get_id().replace(basicid, susidiesid);
                    var kpiclientid = sender.get_id().replace(basicid, kpi);
                    var grossclientid = sender.get_id().replace(basicid, grossid);
                    var txtgross = $find(grossclientid);
                    var txtSusidies = $find(susidiesclientid);
                    var txtKPI = $find(kpiclientid);

                    txtSusidies.set_value(txtgross.get_value() - txtCanban.get_value() - txtKPI.get_value());
                }
                this.Call_SalaryKPI = function (sender, event) {
                    var txtKPI = sender;
                    var susidiesclientid = sender.get_id().replace(kpi, susidiesid);
                    var basicclientid = sender.get_id().replace(kpi, basicid);
                    var grossclientid = sender.get_id().replace(kpi, grossid);
                    var txtgross = $find(grossclientid);
                    var txtSusidies = $find(susidiesclientid);
                    var txtCanban = $find(basicclientid);

                    txtSusidies.set_value(txtgross.get_value() - txtCanban.get_value() - txtKPI.get_value());
                }
            }

            var check = new CheckGrid();
            function CheckGrid() {
                this.CheckValidForDelete = function (sender, event) {
                    //Kiểm tra đã chọn dòng cần xóa?
                    if (new Grid().CheckRowSelectedPemission("<%= dtgWorkingRecord.MasterTableView.ClientID %>") == false) {
                        new Message().ShowObject(alertmsg_12245);
                        return false;
                    }
                }
            }

            //Hàm enable các require field trên lưới nếu dòng đó được chọn
            function RowSelectInGrid(rowObject, event) {
                var grid = $find("<%= dtgWorkingRecord.ClientID %>");
                var masterTable = grid.get_masterTableView();
                var row = masterTable.get_dataItems()[event.get_itemIndexHierarchical()];
                var rfvLoaiHTTD = row.findElement("rfvLoaiHTTD");
                var rfvHTTD = row.findElement("rfvHTTD");
                var rfvNgayhieuluc = row.findElement("rfvNgayhieuluc");
                var rfvCocautochuc = row.findElement("rfvCocautochuc");
                var rfvChucvu = row.findElement("rfvChucvu");
                var rfvProChart = row.findElement("rfvProChart");
                var rfvCapbac = row.findElement("rfvCapbac");
                if (rfvLoaiHTTD != null)
                    ValidatorEnable(rfvLoaiHTTD, true);
                if (rfvHTTD != null)
                    ValidatorEnable(rfvHTTD, true);
                if (rfvNgayhieuluc != null)
                    ValidatorEnable(rfvNgayhieuluc, true);
                if (rfvCocautochuc != null)
                    ValidatorEnable(rfvCocautochuc, true);
                if (rfvChucvu != null)
                    ValidatorEnable(rfvChucvu, true);
                if (rfvProChart != null)
                    ValidatorEnable(rfvProChart, true);
                if (rfvCapbac != null)
                    ValidatorEnable(rfvCapbac, true);
            }

            //Hàm disable các require field trên lưới nếu dòng đó không được chọn
            function RowUnSelectInGrid(rowObject, event) {
                var grid = $find("<%= dtgWorkingRecord.ClientID %>");
                var masterTable = grid.get_masterTableView();
                var row = masterTable.get_dataItems()[event.get_itemIndexHierarchical()];
                var rfvLoaiHTTD = row.findElement("rfvLoaiHTTD");
                var rfvHTTD = row.findElement("rfvHTTD");
                var rfvNgayhieuluc = row.findElement("rfvNgayhieuluc");
                var rfvCocautochuc = row.findElement("rfvCocautochuc");
                var rfvChucvu = row.findElement("rfvChucvu");
                var rfvProChart = row.findElement("rfvProChart");
                var rfvCapbac = row.findElement("rfvCapbac");
                if (rfvLoaiHTTD != null)
                    ValidatorEnable(rfvLoaiHTTD, false);
                if (rfvHTTD != null)
                    ValidatorEnable(rfvHTTD, false);
                if (rfvNgayhieuluc != null)
                    ValidatorEnable(rfvNgayhieuluc, false);
                if (rfvCocautochuc != null)
                    ValidatorEnable(rfvCocautochuc, false);
                if (rfvChucvu != null)
                    ValidatorEnable(rfvChucvu, false);
                if (rfvProChart != null)
                    ValidatorEnable(rfvProChart, false);
                if (rfvCapbac != null)
                    ValidatorEnable(rfvCapbac, false);
            }

            function ClosePage() {
                var win = new WindowManager().GetRadWindow();
                win.close();
            }

            function LoadMaximize() {
                try {
                    var win = new WindowManager().GetRadWindow();
                    if (win != null) {
                        win.maximize();
                    }
                }
                catch (err) {
                }
            }
        </script>
    </telerik:RadCodeBlock>

    
</asp:Content>
